package com.power.mock.answerandcapture;

import com.google.inject.Inject;
import com.power.mock.User;
import com.power.mock.dto.UserQueryDTO;
import com.power.mock.init.PowerInit;
import com.power.mock.util.WJedisHelper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

/**
 * @author wangjianxin01
 */
public class UserService {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    public UserService() {
        PowerInit.injector.injectMembers(this);
    }

    @Inject
    private UserDAO userDAO;


    public List<User> listUser(String userName, Integer age) {
        logger.info("in method UserService.listUser(String userName, Integer age), userName = {}, age = {}" ,userName, age );
        UserQueryDTO userQueryDTO = new UserQueryDTO();
        userQueryDTO.setUserName(userName);
        userQueryDTO.setAge(age);
        return userDAO.listUser(userQueryDTO);
    }


}
